* note -------------------------------------------------------------------------

* this is one of the two master replication files for:
*
* umit, r. rallies around the flag-draped coffins: the electoral effects of 
* security force casualties in terror attacks. conditionally accepted (pending 
* replication) for publication in political science research and methods.
*
* the other master replication file is called analysis.R 
*
* replication requires the following directory structure:
*
* working_directory/
*  |
*  +---analysis.do
*  +---analysis.R
*  |
*  +---datasets/
*  |       data_*
*  |
*  +---figures/
*  |       
*  |
*  +---scripts/
*  |       script_*
*  |
*  \---tables/
*
* replication also requires two third-party packages, which can be installed by
* removing the leading asterisks from the lines 38 and 39 below.
*
* declare the stata release used -----------------------------------------------

version 16.1

* install the required third-party packages ------------------------------------

* ssc install estout
* ssc install ebalance

* import the fdc dataset -------------------------------------------------------

import delimited "./datasets/data_fdc.csv"

* label the variables in the main text -----------------------------------------

label variable akp_nov             "Post-test"

label variable treatment           "Treatment"
label variable treatment_multi     "Multiple Treatment"

label variable akp_jun             "Pre-test"
label variable recruitment_pool    "Recruitment Pool" 

label variable treatment_nonterror "Non-terror Funeral"
label variable casualty_district   "Attack District"
label variable kurdish_district    "Kurdish District"
label variable akp_district        "AKP District"
label variable higher_education    "Higher Education"
label variable min_margin          "Electoral Margin"
label variable turnout_jun         "Turnout"

* source the script that creates table 1 ---------------------------------------

do "./scripts/script_table_1.do"

* source the script that creates table s1 --------------------------------------

do "./scripts/script_table_s1.do"

* source the script that creates table s2 --------------------------------------

do "./scripts/script_table_s2.do"

* source the script that creates table s3 --------------------------------------

do "./scripts/script_table_s3.do"

* source the script that creates table s5 --------------------------------------

do "./scripts/script_table_s5.do"

* source the script that creates table s6 --------------------------------------

do "./scripts/script_table_s6.do"

* source the script that creates table s7 --------------------------------------

do "./scripts/script_table_s7.do"

* source the script that creates table s8 --------------------------------------

do "./scripts/script_table_s8.do"

* source the script that creates table s9 --------------------------------------

do "./scripts/script_table_s9.do"

* source the script that creates table s10 -------------------------------------

do "./scripts/script_table_s10.do"

* source the script that creates table s11 -------------------------------------

do "./scripts/script_table_s11.do"

* source the script that creates table s12 -------------------------------------

do "./scripts/script_table_s12.do"

* source the script that creates table s13 -------------------------------------

do "./scripts/script_table_s13.do"

* source the script that creates table s14 -------------------------------------

do "./scripts/script_table_s14.do"

* source the script that creates table s15 -------------------------------------

do "./scripts/script_table_s15.do"

* source the script that creates table s16 -------------------------------------

do "./scripts/script_table_s16.do"

* source the script that creates table s17 -------------------------------------

do "./scripts/script_table_s17.do"